//
//  RadioCell.m
//  Pianke
//
//  Created by BetaTheta on 16/1/20.
//  Copyright © 2016年 BetaTheta. All rights reserved.
//

#import "RadioCell.h"

@interface RadioCell ()
@property (nonatomic, retain) UIImageView *listenerImg;
@end
@implementation RadioCell
// 内存管理
- (void)dealloc
{
    [_titleLabel release];
    [_coverimg release];
    [_unameLabel release];
    [_describeLabel release];
    [_listenerImg release];
    [_countLabel release];
    [super dealloc];
}
// 初始化
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //
        self.titleLabel = [[UILabel alloc] init];
        _titleLabel.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_titleLabel];
        [_titleLabel release];
        //
        self.coverimg = [[UIImageView alloc] init];
        _coverimg.backgroundColor = [UIColor orangeColor];
        [self.contentView addSubview:_coverimg];
        [_coverimg release];
        //
        self.unameLabel = [[UILabel alloc] init];
        _unameLabel.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:_unameLabel];
        [_unameLabel release];
        //
        self.describeLabel = [[UILabel alloc] init];
        _describeLabel.backgroundColor =[UIColor magentaColor];
        [self.contentView addSubview:_describeLabel];
        [_describeLabel release];
        //
        self.listenerImg = [[UIImageView alloc] init];
        _listenerImg.backgroundColor = [UIColor cyanColor];
        [self.contentView addSubview:_listenerImg];
        [_listenerImg release];
        //
        self.countLabel = [[UILabel alloc] init];
        _countLabel.backgroundColor = [UIColor purpleColor];
        [self.contentView addSubview:_countLabel];
        [_countLabel release];
    }
    return self;
}
// 布局
- (void)layoutSubviews
{
    _coverimg.frame = CGRectMake(5, 5, 90, 90);
    _titleLabel.frame = CGRectMake(100, 5, 160, 30);
    _unameLabel.frame = CGRectMake(100, 35, 160, 15);
    _describeLabel.frame = CGRectMake(100, 50, 270, 15);
    _listenerImg.frame = CGRectMake(270, 5, 15, 15);
    _countLabel.frame = CGRectMake(285, 5, 70, 15);
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
